home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr18 / mrun210.zip / MRUN210E.WAS < prev    next >
Text File  |  1993-04-28  |  20KB  |  763 lines

  1. ;MailRun v2.10:  Part E, addulfile
  2. ;1992-1993 Gerald P. Sully, all rights reserved.
  3.  
  4. #comment
  5. **************************************************************************
  6. **************************************************************************
  7. * This file contains routines related to adding a "Upload File"
  8. * item to a mailrun.  It puts up the Upload Files dialog box,
  9. * which displays the contents of the available files index (the
  10. * *.udx file for the mailrun).  When a file is selected from the 
  11. * list, a detailed description is displayed from the *.ubf file 
  12. * for the mailrun).
  13. **************************************************************************
  14. **************************************************************************
  15. #endcomment
  16.  
  17. #define MRUN210E
  18. #define MRUN210DE
  19.  
  20. #include "mrun210.h"
  21.  
  22. string DXFileTabs, OldUDX, OldUBF, MRunUDX, MRunUBF, LastChoice
  23. string UploadDir, DownloadDir
  24. integer InULDir, ULSortField
  25.  
  26. #comment
  27. *********************************************************************
  28. * MAIN()
  29. * Calls checkchild(), updateudx(), interfaceon(), getnewdesc(),
  30. * getbbsi(), getitemi(), getulfiles(), checkchanged(), 
  31. * getbbscoord(), getitemcoord(), gettaskstring(),
  32. * makebbslist(), ulfilebox(), insertulfile(), delulfile(),
  33. * menudim(), makefullname(), sortidx(), checkfile(),
  34. * clearfiledesc()
  35. * Adds a SendFile item to the mailrun.  An feditbox is
  36. * used to display the file description in order to take
  37. * advantage of wordwrap.  The flistbox displays the
  38. * contents of MAILRUN.UDX, which contains information on
  39. * any file downloaded by MailRun, plus additional files
  40. * found in the upload directory.  A file description must
  41. * be at least 6 characters, but may be as long as needed.
  42. *********************************************************************
  43. #endcomment
  44.  
  45. proc main
  46. string LastUDX, LastUBF, FullFileName, temp
  47. integer dialogstatus
  48. integer i, j, InUDX
  49.     menudim()
  50.     checkchild()
  51.     findfirst MailRun
  52.     MailRunTrunc = $FILENAME
  53.     DXFileTabs = "58,92,130,305,315,319,322,325,328"
  54.     profilerd MailRun "MailRun" "UploadDir" UploadDir
  55.     profilerd MailRun "MailRun" "DownloadDir" DownloadDir
  56.     profilerd MailRun "MailRun" "ULSortField" ULSortField
  57.     i = getbbsi()
  58.     j = getitemi()
  59.     FileDesc = makefullname(TempDir, "DESC.TMP")
  60.     OldUDX = makefullname(TempDir, "OLDUDX.TMP")
  61.     OldUBF = makefullname(TempDir, "OLDUBF.TMP")
  62.     LastUDX = makefullname(MailRunDir, "MAILRUN.UDX")
  63.     LastUBF = makefullname(MailRunDir, "MAILRUN.UBF")
  64.     MRunUDX = makefullname(TempDir, "MAILRUN.UDX")
  65.     MRunUBF = makefullname(TempDir, "MAILRUN.UBF")
  66.     if isfile FileDesc
  67.         delfile FileDesc
  68.     endif
  69.     if isfile MRunUDX
  70.         delfile MRunUDX
  71.     endif
  72.     if isfile MRunUBF
  73.         delfile MRunUBF
  74.     endif
  75.     copyfile LastUDX MRunUDX
  76.     copyfile LastUBF MRunUBF
  77.     if not (checkfile(MRunUDX) && checkfile(MRUNUBF))
  78.         getulfiles()
  79.     endif
  80.     LastChoice = ""
  81.     FLAGS &= UNCHANGED
  82.     interfaceon()
  83.     makebbslist()
  84.     ulfilebox()
  85.     dialogstatus = $DIALOG
  86.     while dialogstatus != 1
  87.         switch dialogstatus
  88.             case 10
  89.                 ;User selected "Add"
  90.                 insertulfile(&j)
  91.                 TaskItem = gettaskstring(i, j)
  92.             endcase
  93.             case 11
  94.                 ;User selected "Save"
  95.                 if FLAGS & CHANGED
  96.                     updateudx()
  97.                     FLAGS &= UNCHANGED
  98.                     updatedlg -1
  99.                 endif
  100.             endcase
  101.             case 12
  102.                 ;User selected "Delete"
  103.                 delulfile()
  104.             endcase
  105.             case 13
  106.                 ;User selected "Refresh"
  107.                 statmsg "Refreshing Uploads List from Upload Directory..."
  108.                 getulfiles()
  109.                 updatedlg -1
  110.                 statmsg ""
  111.             endcase
  112.             case 50
  113.                 ;User selected a sort radiobutton
  114.                 profilewr MailRun "MailRun" "ULSortField" ULSortField
  115.                 sortidx(MRunUDX, ULSortField)
  116.                 updatedlg 16
  117.             endcase
  118.             case 130
  119.                 ;User selected a file from the listbox
  120.                 if checkchanged()
  121.                     getnewdesc()
  122.                     updatedlg 137
  123.                 else
  124.                     FileChoice = LastChoice
  125.                     updatedlg 16
  126.                 endif
  127.             endcase
  128.             case 170
  129.                 ;User changed BBSs with the combobox
  130.                 i = getbbscoord()
  131.                 j = getitemcoord()
  132.                 TaskItem = gettaskstring(i, 0)
  133.             endcase
  134.             case 230
  135.                 ;User entered a name in the File Name box
  136.                 FullFileName = makefullname(UploadDir, FileName)
  137.                 if isfile FullFileName
  138.                     InULDir = 1
  139.                 else
  140.                     InULDir = 0
  141.                 endif
  142.                 interfaceoff()
  143.                 openfile(MRunUDXFile, MRunUDX, _READWRITE, _TEXT)
  144.                 InUDX = checkudx(FileName)
  145.                 if InUDX
  146.                     fseek MRunUDXFile -100 1
  147.                     fgets MRunUDXFile FileChoice
  148.                     fgets MRunUDXFile FileChoice
  149.                     strextract temp FileChoice "`t" 0
  150.                     while not strcmpi temp FileName
  151.                         fgets MRunUDXFile FileChoice
  152.                         strextract temp FileChoice "`t" 0
  153.                     endwhile
  154.                 endif
  155.                 fclose MRunUDXFile
  156.                 interfaceon()
  157.                 if InUDX
  158.                     makedesc(MRunUBF)
  159.                 else                
  160.                     clearfiledesc()
  161.                 endif
  162.                 updatedlg -1
  163.             endcase
  164.             case 250
  165.                 ;User entered a file description
  166.                 if !(FLAGS & CHANGED)
  167.                     FLAGS |= CHANGED
  168.                 endif
  169.             endcase
  170.         endswitch
  171.         dialogstatus = $DIALOG
  172.     endwhile
  173.     delfile LastUDX
  174.     delfile LastUBF
  175.     copyfile MRunUDX LastUDX
  176.     copyfile MRunUBF LastUBF
  177. endproc
  178.  
  179.  
  180. #comment
  181. *********************************************************************
  182. * INSERTULFILE()
  183. * Called by main()
  184. * Calls checkperm(), openfile(), updateudx(), insertitem(),
  185. * interfaceon(), interfaceoff(), makefullname(), checkudx(),
  186. * clearfiledesc(), shortdesc()
  187. * Adds a SendFile item to the *.MRN file and the task list.
  188. *********************************************************************
  189. #endcomment
  190.  
  191. proc insertulfile
  192. intparm j
  193. string ULDescString, ULFileString, FullFileName
  194. string ULFileSpec, Perm
  195. string StatString, CopyboxMsg
  196. integer ULDescLength
  197. integer Response, InUDX
  198.     interfaceoff()
  199.     if NULLSTR FileName
  200.         ;User hasn't selected a file
  201.         usermsg "You must select a file first."
  202.         return
  203.     endif
  204.     if InULDir == 0
  205.         strupr FileName
  206.         strfmt CopyBoxMsg \
  207.             "%s is not in the Upload Directory.`r`nCopy it now?" \
  208.             FileName
  209.         strlwr FileName
  210.         sdlgmsgbox "MailRun Message" CopyBoxMsg QUESTION \
  211.             OKCANCEL Response 1
  212.         switch Response
  213.             case 1
  214.                 ;User selected "OK"
  215.                 ULFileSpec = makefullname(DownloadDir, FileName)
  216.                 dir ULFileSpec FullFileName
  217.                 if NULLSTR FullFileName
  218.                     return
  219.                 endif
  220.                 if not isfile FullFileName
  221.                     sdlgmsgbox "MailRun Message" "No such file!" \
  222.                         EXCLAMATION OK Response 1
  223.                     return
  224.                 endif
  225.                 copyfile FullFileName UploadDir
  226.                 if not strcmpi ULFileSpec FullFileName
  227.                     ;if the user chose a file other than the one specified
  228.                     ;get the name of the file
  229.                     findfirst FullFileName
  230.                     FileName = $FILENAME
  231.                     strlwr FileName
  232.                     ;determine whether it is already in the uploads database
  233.                     openfile(MRunUDXFile, MRunUDX, _READWRITE, _TEXT)
  234.                     InUDX = checkudx(FileName)
  235.                     fclose MRunUDXFile
  236.                     if InUDX == 0
  237.                         ;if it isn't in the uploads database, put it there
  238.                         clearfiledesc()
  239.                         FLAGS |= CHANGED
  240.                         updateudx()
  241.                     endif
  242.                 endif
  243.                 InULDir = 1
  244.                 updatedlg -1
  245.             endcase
  246.             case 2
  247.                 ;User selected "Cancel"
  248.                 return
  249.             endcase
  250.         endswitch
  251.     endif
  252.     ;No description may be less than 30 characters
  253.     openfile(FileDescFile, FileDesc, _READWRITE, _NORMAL)
  254.     fread FileDescFile ULDescString 65 ULDescLength
  255.     fclose FileDescFile
  256.     if ULDescLength < 6
  257.         usermsg "Please enter a longer description."
  258.     elseif shortdesc(ULDescString, ULDescLength)
  259.         ;If everything is OK...
  260.         if FLAGS & CHANGED
  261.             ;Add the new description to the database
  262.             updateudx()
  263.             FLAGS &= UNCHANGED
  264.             updatedlg 16
  265.         endif
  266.         Perm = checkperm()
  267.         strupr FileName
  268.         strfmt ULFileString \
  269.             "1,%s,SendFile,%s,%s" Perm FileName Conf
  270.         strfmt StatString \
  271.             "Added to %s:  `"Upload %s to Conference %s`"" \
  272.             BBS FileName Conf
  273.         j++
  274.         insertitem(j, ULFileString)
  275.         strlwr FileName
  276.         statmsg StatString
  277.     endif
  278.     interfaceon()
  279. endproc
  280.  
  281.  
  282. #comment
  283. *********************************************************************
  284. * SHORTDESC()
  285. * Called by insertulfile()
  286. * Calls findstring()
  287. * If the current BBS type is WildCat! or RBBS, limits the 
  288. * upload description length to 60 or 45 characters,
  289. * respectively.  Gives user an opportunity to enter a new 
  290. * description if the current one is too long.
  291. *********************************************************************
  292. #endcomment
  293.  
  294. func shortdesc : integer
  295. strparm ULDescString
  296. intparm ULDescLength
  297. string ULMsg, TypeName
  298. integer Response, MaxLength
  299.     profilerd MailRun BBS "BBSType" BBSType
  300.     if (findstring(BBSType, "WildCat") && (ULDescLength > 60)) || \
  301.         (findstring(BBSType, "RBBS") && (ULDescLength > 45))
  302.         if findstring(BBSType, "WildCat")
  303.             substr ULDescString ULDescString 0 60
  304.             MaxLength = 60
  305.             TypeName = "WildCat!"
  306.         else
  307.             substr ULDescString UlDescString 0 45
  308.             MaxLength = 45
  309.             TypeName = "RBBS"
  310.         endif
  311.         strfmt ULMsg "A %s file description has a maximum length \
  312. of %d characters.  The description for %s will be truncated to read:\
  313. `r`n`r`n%s`r`n`r`nDo you wish to continue?" \
  314.             TypeName MaxLength FileName ULDescString
  315.         sdlgmsgbox "MailRun Message" ULMsg QUESTION YESNO Response 2
  316.         switch Response
  317.             case 6
  318.                 return 1
  319.             endcase
  320.             case 7
  321.                 return 0
  322.             endcase
  323.         endswitch
  324.     else
  325.         return 1
  326.     endif
  327. endfunc
  328.  
  329.  
  330. #comment
  331. *********************************************************************
  332. * DELULFILE()
  333. * Called by main()
  334. * Calls killfile(), makefullname()
  335. * Deletes a file from the upload database index.
  336. *********************************************************************
  337. #endcomment
  338.  
  339. proc delulfile
  340. string DelBoxMsg, FullFileName
  341. integer Response
  342.     if not NULLSTR FileName
  343.         if InULDir == 1
  344.             ;If the selected file is in the upload directory
  345.             strfmt DelBoxMsg "Delete file %s as well?" FileName
  346.             sdlgmsgbox "MailRun Message" DelBoxMsg QUESTION \
  347.                 YESNOCANCEL Response 1
  348.             switch Response
  349.                 case 2
  350.                     ;User selected "Cancel"
  351.                     return
  352.                 endcase
  353.                 case 6
  354.                     ;User selected "Yes"
  355.                     FullFileName = makefullname(UploadDir, FileName)
  356.                     delfile FullFileName
  357.                 case 7
  358.                     ;User selected "No"
  359.                     killfile()
  360.                 endcase
  361.             endswitch
  362.         else
  363.             killfile()
  364.         endif
  365.         FLAGS &= UNCHANGED
  366.         updatedlg -1
  367.     endif
  368. endproc
  369.  
  370.  
  371. #comment
  372. *********************************************************************
  373. * KILLFILE()
  374. * Called by delulfile()
  375. * Calls openfile(), clearfiledesc(), getnewdesc()
  376. * Deletes a file from the upload database index.
  377. *********************************************************************
  378. #endcomment
  379.  
  380. proc killfile
  381. string UDXString, UDXFile, temp
  382.     ;Copy all but the new description to the new UDX file
  383.     copyfile MRunUDX OldUDX
  384.     openfile(OldUDXFile, OldUDX, _READWRITE, _TEXT)
  385.     openfile(MRunUDXFile, MRunUDX, _CREATE, _TEXT)
  386.     fgets OldUDXFile UDXString
  387.     while not feof OldUDXFile
  388.         ;Read lines until the end of file or the current file
  389.         strextract UDXFile UDXString "`t" 0
  390.         if strcmpi UDXFile FileName
  391.             exitwhile
  392.         endif
  393.         fputs MRunUDXFile UDXString
  394.         fgets OldUDXFile UDXString
  395.     endwhile
  396.     fgets OldUDXFile UDXString
  397.     ;get the new listbox selection
  398.     FileChoice = UDXString
  399.     while not feof OldUDXFile
  400.         fputs MRunUDXFile UDXString
  401.         fgets OldUDXFile UDXString
  402.     endwhile
  403.     if NULLSTR FileChoice
  404.         ;if the deleted line was the last in the file
  405.         ;back up one line and read it
  406.         fseek MRunUDXFile -100 2
  407.         fgets MRunUDXFile temp
  408.         while not NULLSTR temp
  409.             FileChoice = temp
  410.             fgets MRunUDXFile temp
  411.         endwhile
  412.     endif
  413.     if not NULLSTR FileChoice
  414.         getnewdesc()
  415.     else
  416.         FileName = ""
  417.         clearfiledesc()
  418.     endif
  419.     fclose OldUDXFile
  420.     fclose MRunUDXFile
  421.     delfile OldUDX
  422. endproc
  423.  
  424.  
  425. #comment
  426. *********************************************************************
  427. * GETNEWDESC()
  428. * Called by main(), killfile()
  429. * Calls makedesc(), makefullname()
  430. * Gets the file name and description from the index entry
  431. * and determines whether the file is in the upload directory.
  432. *********************************************************************
  433. #endcomment
  434.  
  435. proc getnewdesc
  436. string FullFileName
  437.     LastChoice = FileChoice
  438.     strextract FileName FileChoice "`t" 0
  439.     FullFileName = makefullname(UploadDir, FileName)
  440.     if isfile FullFileName
  441.         InULDir = 1
  442.     else
  443.         InULDir = 0
  444.     endif
  445.     makedesc(MRunUBF)
  446. endproc
  447.  
  448.  
  449. #comment
  450. *********************************************************************
  451. * GETULFILES()
  452. * Called by main()
  453. * Calls openfile(), checkudx(), checkfile(), sortidx(),
  454. * interfaceon(), interfaceoff(), makefullname()
  455. * Updates the Upload directory file description database.
  456. *********************************************************************
  457. #endcomment
  458.  
  459. proc getulfiles
  460. string FileSize, FileDate, FDesc, DescBegin, DescLength, UDXString
  461. string ULFileFull, ULFileTrunc, FullFileName
  462. long FS, DB, DL, NDB, counter
  463. integer char
  464. integer InUDX
  465.     interfaceoff()
  466.     if checkfile(MRunUDX) && checkfile(MRunUBF)
  467.         copyfile MRunUDX OldUDX
  468.         copyfile MRunUBF OldUBF
  469.         openfile(OldUDXFile, OldUDX, _READWRITE, _TEXT)
  470.         openfile(OldUBFFile, OldUBF, _READWRITE, _NORMAL)
  471.     else
  472.         openfile(OldUDXFile, OldUDX, _CREATE, _TEXT)
  473.         openfile(OldUBFFile, OldUBF, _CREATE, _NORMAL)
  474.     endif
  475.     openfile(MRunUDXFile, MRunUDX, _CREATE, _TEXT)
  476.     openfile(MRunUBFFile, MRunUBF, _CREATE, _NORMAL)
  477.     fgets OldUDXFile UDXString
  478.     while not feof OldUDXFile
  479.         ;loop through the old .UDX file
  480.         ;extract all fields
  481.         strextract ULFileTrunc UDXString "`t" 0
  482.         strextract FileSize UDXString "`t" 1
  483.         strextract FileDate UDXString "`t" 2
  484.         strextract FDesc UDXString "`t" 3
  485.         strextract DescBegin UDXString "`t" 4
  486.         strextract DescLength UDXString "`t" 5
  487.         atol DescBegin DB
  488.         atol DescLength DL
  489.         ftell MRunUBFFile NDB
  490.         ;go to the beginning of the file description
  491.         fseek OldUBFFile DB 0
  492.         ;copy the description to the new .UBF file
  493.         for counter = 1 upto DL
  494.             fgetc OldUBFFile char
  495.             fputc MRunUBFFile char
  496.         endfor
  497.         ;add the index line to the new .UDX file
  498.         fstrfmt MRunUDXFile "%s`t%s`t%s`t%s`t%ld`t%ld`r`n" \
  499.             ULFileTrunc FileSize FileDate FDesc NDB DL
  500.         fgets OldUDXFile UDXString
  501.     endwhile
  502.     ;Add any new files found in the uploads directory
  503.     FullFileName = makefullname(UploadDir, "*.*")
  504.     findfirst FullFileName
  505.     while FOUND
  506.         ;Loop through all files in the upload directory
  507.         ULFileTrunc = $FILENAME
  508.         InUDX = checkudx(ULFileTrunc)
  509.         if InUDX == 0
  510.             ULFileFull = makefullname(UploadDir, ULFileTrunc)
  511.             getfsize ULFileFull FS
  512.             getfdate ULFileFull FileDate
  513.             strlwr ULFileTrunc
  514.             fseek MRunUDXFile 0 2
  515.             fstrfmt MRunUDXFile "%s`t%ld`t%s`t`t0`t0`r`n" \
  516.                 ULFileTrunc FS FileDate
  517.         endif
  518.         findnext
  519.     endwhile
  520.     fclose MRunUDXFile
  521.     fclose MRunUBFFile
  522.     fclose OldUDXFile
  523.     fclose OldUBFFile
  524.     delfile OldUDX
  525.     delfile OldUBF
  526.     interfaceon()
  527.     sortidx(MRunUDX, ULSortField)
  528. endproc
  529.  
  530.  
  531. #comment
  532. *********************************************************************
  533. * CHECKUDX()
  534. * Called by insertulfile(), getulfiles()
  535. * Checks whether a given file is already in the UDX List.
  536. * If it is, a value of 1 is returned, if not, the file
  537. * is added to the list and a value of 0 is returned.
  538. *********************************************************************
  539. #endcomment
  540.  
  541. func checkudx : integer
  542. strparm CkFileName
  543. string UDXFile, UDXFileString
  544. integer InUDX
  545.     rewind MRunUDXFile
  546.     InUDX = 0
  547.     fgets MRunUDXFile UDXFileString
  548.     while not feof MRunUDXFile
  549.         strextract UDXFile UDXFileString "`t" 0
  550.         if strcmpi CkFileName UDXFile
  551.             InUDX = 1
  552.             exitwhile
  553.         endif
  554.         fgets MRunUDXFile UDXFileString
  555.     endwhile
  556.     return InUDX
  557. endfunc
  558.  
  559.  
  560. #comment
  561. *********************************************************************
  562. * UPDATEUDX()
  563. * Called by main(), insertulfile()
  564. * Calls openfile(), interfaceon(), interfaceoff(),
  565. * makefullname(), sortidx()
  566. * Updates the Upload directory file description database
  567. * and index files.
  568. *********************************************************************
  569. #endcomment
  570.  
  571. proc updateudx
  572. string FileDate, FileSize, FullFileName
  573. string ULDescString, UDXString, UDXFile
  574. long DescBegin, DescLength, l
  575. integer ULDescLength
  576. integer char
  577.     interfaceoff()
  578.     ;Copy all but the new description to the new UDX file
  579.     copyfile MRunUDX OldUDX
  580.     openfile(OldUDXFile, OldUDX, _READWRITE, _TEXT)
  581.     openfile(MRunUDXFile, MRunUDX, _CREATE, _TEXT)
  582.     fgets OldUDXFile UDXString
  583.     while not feof OldUDXFile
  584.         ;Read lines until the end of file or the current file
  585.         strextract UDXFile UDXString "`t" 0
  586.         if strcmpi UDXFile FileName
  587.             exitwhile
  588.         endif
  589.         fputs MRunUDXFile UDXString
  590.         fgets OldUDXFile UDXString
  591.     endwhile
  592.     ;Get the size and date
  593.     if NULLSTR UDXString
  594.         FullFileName = makefullname(UploadDir, FileName)
  595.         if isfile FullFileName
  596.             getfsize FullFileName l
  597.             ltoa l FileSize
  598.             getfdate FullFileName FileDate
  599.             InULDir = 1
  600.         else
  601.             FileSize = "???"
  602.             FileDate = "??/??/??"
  603.             InULDir = 0
  604.         endif
  605.     else
  606.         strextract FileSize UDXString "`t" 1
  607.         strextract FileDate UDXString "`t" 2
  608.     endif
  609.     ;Discard the old description line
  610.     fgets OldUDXFile UDXString
  611.     FileChoice = UDXString
  612.     while not feof OldUDXFile
  613.         fputs MRunUDXFile UDXString
  614.         fgets OldUDXFile UDXString
  615.     endwhile
  616.     openfile(MRunUBFFile, MRunUBF, _READWRITE, _NORMAL)
  617.     ;go to the end of the description database
  618.     fseek MRunUBFFile 0 2
  619.     ftell MRunUBFFile DescBegin
  620.     DescLength = 0
  621.     ULDescLength = 0
  622.     ULDescString = ""
  623.     
  624.     ;read characters from the description box into the database
  625.     openfile(FileDescFile, FileDesc, _READWRITE, _NORMAL)
  626.     fgetc FileDescFile char
  627.     while not feof FileDescFile
  628.         ;read characters until all have been read
  629.         if ((char >= 0x20) && (char <= 0x7E)) || \
  630.             ((char >= 0xA0) && (char <= 0xFE))
  631.             ;Ignore non-printing characters
  632.             fputc MRunUBFFile char
  633.             if ULDescLength < 46
  634.                 ;No special characters in the index file either
  635.                 strfmt ULDescString "%s%c" ULDescString char
  636.                 ULDescLength++
  637.             endif
  638.             DescLength++
  639.         endif
  640.         fgetc FileDescFile char
  641.     endwhile
  642.     fclose MRunUBFFile
  643.     fclose FileDescFile
  644.     
  645.     ;Strip partial words from end of description
  646.     if ULDescLength == 46
  647.         ULDescLength--
  648.         strpeek ULDescString ULDescLength char
  649.         while char > 32
  650.             strdelete ULDescString ULDescLength 1
  651.             ULDescLength--
  652.             strpeek ULDescString ULDescLength char
  653.         endwhile
  654.     endif
  655.     
  656.     strfmt FileChoice "%s`t%s`t%s`t%s`t%ld`t%ld" \
  657.         FileName FileSize FileDate ULDescString DescBegin DescLength
  658.     fputs MRunUDXFile FileChoice
  659.     fclose OldUDXFile
  660.     fclose MRunUDXFile
  661.     delfile OldUDX
  662.     sortidx(MRunUDX, ULSortField)
  663.     interfaceon()
  664. endproc
  665.  
  666.  
  667. #comment
  668. *********************************************************************
  669. * ULFILEBOX()
  670. * Called by main()
  671. * Draws the Upload Files Dialog Box.
  672. *********************************************************************
  673. #endcomment
  674.  
  675. proc ulfilebox
  676. PermRadio = 2
  677. Conf = "0"
  678. FileName = ""
  679. destroydlg
  680. HelpPage = 10
  681. dialogbox 19 38 324 201 15 "Upload Files" HELPID HelpPage
  682.    text  12 27 56 8 left "Filename"
  683.    text  70 27 40 8 left "Size"
  684.    text  104 27 34 8 left "Date"
  685.    text  142 27 117 8 left "Description"
  686.    flistbox 12 38 300 50 MRunUDX DXFileTabs single FileChoice
  687.    groupbox 12 89 300 17
  688.    radiobutton 26 94 60 11 "Unsorted" ULSortField
  689.    radiobutton 91 94 67 11 "Sort by Name" 
  690.    radiobutton 172 94 61 11 "Sort by Size" 
  691.    radiobutton 241 94 62 11 "Sort by Date" endgroup
  692.    text  13 112 49 8 left "Filename:"
  693.    editbox 12 122 101 12 FileName
  694.    text  129 112 67 8 left "Description:"
  695.    feditbox 129 122 182 50 FileDesc
  696.    text  14 158 78 8 right "U/L to Conference:"
  697.    editbox 96 156 16 12 Conf
  698.    radiobutton 12 178 53 13 "Permanent" PermRadio
  699.    radiobutton 70 178 54 13 "Temporary" endgroup
  700.    pushbutton 130 179 30 14 "&Add" normal default
  701.    pushbutton 168 179 30 14 "&Save" normal
  702.    pushbutton 206 179 30 14 "De&lete" normal
  703.    pushbutton 244 179 30 14 "&Refresh" normal
  704.    pushbutton 282 179 30 14 "&Done" cancel
  705.    text  76 9 80 8 right "Upload File to:"
  706.    combobox 160 7 70 42 BBSList BBS sort
  707.    checkbox 13 140 100 10 "File in uploads directory?" InULDir
  708. enddialog
  709. disable CTRL 70
  710. endproc
  711.  
  712.  
  713.  
  714.